public class ThreadTest623 {
    public static void main(String[] args) throws InterruptedException {
        Thread a = new Thread(()->{
            System.out.print("a");
        });
        Thread b = new Thread(()->{
            try {
                a.join();
                System.out.print("b");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        });
        Thread c = new Thread(()->{
            try {
                b.join();
                System.out.print("c");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        });
        int count = 10;
        while(count>0) {
            a.start();
            b.start();
            c.start();
            System.out.println();
            count--;
        }


    }
}
